from datetime import datetime
from pydantic import BaseModel, Field

class PartnerTokenBase(BaseModel):
    uid: int = Field(default=0, description="用户UID")
    partner: int = Field(default=0, description="合作方")
    accessToken: str = Field(default="", max_length=512, description="用户合作方Token")
    status: int = Field(default=0, description="状态")
    expiresAt: datetime = Field(default_factory=datetime.now, description="过期时间")

class PartnerTokenCreate(PartnerTokenBase):
    pass

class PartnerTokenUpdate(BaseModel):
    accessToken: str = Field(default="", max_length=512, description="用户合作方Token")
    status: int = Field(default=0, description="状态")
    expiresAt: datetime = Field(default_factory=datetime.now, description="过期时间")

class PartnerTokenPublic(PartnerTokenBase):
    pass